<!DOCTYPE html>
<head>
    #parse('base/head.html')
</head>
<body class="no-skin">
<form style="margin-top: 20px" class="form-horizontal" id="reportForm" method="post" action="$!webPath/xxgl/add">
    <input value="$!aidReportDataPO.reportId" type="text" style="display: none" name="reportId"  id="reportId">
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="form-title"> 报送单位 </label>
        <div class="col-sm-9">
            <input value="$!aidReportDataPO.reportDepartment" name="reportDepartment" type="text" id="form-title" placeholder="报送单位" class="col-xs-10 col-sm-5">
            <span style="color: red">*</span>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="form-year"> 报送年 </label>
        <div class="col-sm-9">
            <select  name="reportYear"   value="$!aidReportDataPO.reportYear">
                #foreach($foo in [2017..2050])
                <option value=" $foo">
                    $foo
                </option>
                #end
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="form-month"> 报送月 </label>
        <div class="col-sm-9">
            <select  name="reportMonth"   value="$!aidReportDataPO.reportMonth">
                #foreach($foo in [1..12])
                <option value=" $foo">
                    $foo
                </option>
                #end
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="form-week"> 报送周 </label>
        <div  style="z-index: 9999" class="col-sm-8">
            <input value="$!aidReportDataPO.reportWeek" name="reportWeek" type="number" min="1" max="5" id="form-week" placeholder="报送周" class="col-xs-10 col-sm-5">
        </div>
        </div>
        <div class="form-group" style="z-index: -1">
            <label class="col-sm-2 control-label no-padding-right" for="file"> 附件 </label>
            <div class="col-sm-9">
                <input name="file" type="file">
            </div>
        </div>
        <div class="clearfix form-actions">
            <div class="col-md-offset-3 col-md-9">
                <button id="submitFormBtn" class="btn btn-info" type="button">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    保存
                </button>
            <button onclick="toList()" class="btn" type="reset">
                <i class="ace-icon fa fa-undo bigger-110"></i>
                返回
            </button>
        </div>
    </div>
</form>
</body>
#parse('base/footer.html')
<script>
    $(function ($) {
        $("#submitFormBtn").on('click', function () {
            if($("#form-title").val().trim()==""){
                alert("报送单位不能为空")
                return
            }
            var formData = new FormData($( "#reportForm" )[0]);
            $.ajax({
                type: "POST",
                dataType: "Json",
                url: "$!webPath/xxbs/add",
                data: formData,
                contentType: false,
                processData: false,
                success: function (result) {
                    parent.frames[0].location.href = "$!webPath/xxbs/index"
                },
                error: function (data) {
                }
            });
        })

    })
    function toList() {
        parent.frames[0].location.href = "$!webPath/xxbs/index"
    }
</script>
</html>